package main

import "fmt"

func testPoint(){
  var a *int = new(int)
  *a = 123
  fmt.Printf("*a=%d\n",*a) //*a=123


  //===========================
  var b *[]int = new([]int) //用指针申请一个空切片
  fmt.Printf("*b = %v\n",*b) //*b = []
  (*b) = make([]int,5, 100) //想要操作 还需要使用make做初始化
  (*b)[0] = 100
  (*b)[1] = 100
  fmt.Printf("*b = %v\n",*b) //*b = [100 100 0 0 0]
}

func main() {
  testPoint()
}
